#include <vector>
#include <string>
#include <vector>
#include "CommandCreator.h"
#include "InfoAnalizer.h"

using namespace std;

AbstractCommand *CommandCreator::getCommand(const std::string &commandText) {  
  for (unsigned int i = 0; i < parsers.size(); i++) {
    AbstractCommand *curCommand = parsers[i]->getCommand(commandText);
    if (curCommand != NULL) {
      return curCommand;
    }
  }
  throw std::logic_error("no parser for command" + commandText);  
}